package com.phone.client.controller;

import com.phone.client.poji.entry.TbOrder;
import com.phone.client.poji.vo.MoneyVo;
import com.phone.client.service.OrderService;
import com.seventh.common.pojo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @program: clms-seventh
 * @description: 订单生成
 * @author: 张静
 * @create: 2021-08-07 11:08
 **/
@RestController
@RequestMapping("phone/order")
@Api(tags="车辆订单")
public class OrderController {
    @Autowired
    OrderService orderService;
    @ApiOperation("车辆订单")
    @PostMapping("insertOrder")
    public R insertOrder(@RequestBody TbOrder order){
        return orderService.insertOrder(order);
    }

    //补充信息(读取身份证中的信息)
    @PostMapping("/supplementaryinfo")
    public R supplementaryInfo(MultipartFile file, String type) {

        return orderService.supplementaryInfo(file, type);
    }

    @PostMapping("/addinfo")
    public R addInfo(@RequestBody Map map) {
        return orderService.addInfo(map);
    }
    @GetMapping("orderCar/{carId}")
    public R orderCar(@PathVariable("carId") Integer carId){
        return orderService.getOrderCar(carId);
    }
}
